package com.huitu.whht.base.core.api.wr.sws;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;

import com.huitu.whht.base.core.api.wr.sws.entities.WrSwsB;

import com.huitu.whht.base.core.api.wr.sws.entities.WrSwsBQo;
import com.huitu.whht.base.core.api.wr.sws.service.IWrSwsBService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: 地表水水源地基本信息表API,表名称: WR_SWS_B <br/>
 * 日期: 2019-04-11
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("wr/sws/b")
public class WrSwsBResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(WrSwsBResource.class);

    private static final String UUID = "ad26ffbd-83b2-4c5c-861d-4954bca750da";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IWrSwsBService wrSwsBService;

    /**
     * @api {get} wr/sws/b/{swsCd:\\w{12}} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询WR_SWS_B(地表水水源地基本信息表)数据
     * @apiName (generate)select by primary key
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/sws/b/420822000008
     * @apiParam   {String}         swsCd              【必须】地表水水源地代码
     * @apiSuccess {String}         swsCd              地表水水源地代码
     * @apiSuccess {String}         swsNm              地表水水源地名称
     * @apiSuccess {String}         swsTp              地表水水源地类型
     * @apiSuccess {Double}         watA               水面面积
     * @apiSuccess {String}         wqGoal             水质目标
     * @apiSuccess {String}         consCond           建设状况
     * @apiSuccess {Date}           putProdTm          投产时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {String}         runCond            运行状况
     * @apiSuccess {String}         wsCond             水源供水持续状况
     * @apiSuccess {String}         wsObj              供水对象
     * @apiSuccess {Double}         dywsPp             设计年供水人口
     * @apiSuccess {Double}         dywsW              设计年供水量
     * @apiSuccess {Double}         ddwsW              设计日供水量
     * @apiSuccess {String}         whsManCd           水源地管理单位代码
     * @apiSuccess {String}         whsApprCd          水源地审批单位代码
     * @apiSuccess {String}         emCd               应急管理单位代码
     * @apiSuccess {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {Double}         firProA            一级保护区面积
     * @apiSuccess {Double}         secProA            二级保护区面积
     * @apiSuccess {Double}         norProA            准灌溉区面积
     * @apiSuccess {String}         isEmg              是否为应急水源地
     * @apiSuccess {String}         monG               暂无注释
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{swsCd:\\w{12}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("swsCd") String swsCd) {
        LOGGER.info("根据主键查询 地表水水源地基本信息表,参数 swsCd:{}", swsCd);
        return Response.ok(ApiResultBuilder.create(this, wrSwsBService.selectByPrimaryKey(swsCd))).build();
    }

    /**
     * @api {post} wr/sws/b/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询WR_SWS_B(地表水水源地基本信息表)数据
     * @apiName (generate)select by filter
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/sws/b/list
     * @apiParam   {List(String)}   swsCdList          (数组)地表水水源地代码
     * @apiParam   {String}         swsCd              地表水水源地代码
     * @apiParam   {String}         swsNm              地表水水源地名称
     * @apiParam   {List(String)}   swsTpList          (数组)地表水水源地类型
     * @apiParam   {Double}         watAMin            (最小)水面面积
     * @apiParam   {Double}         watAMax            (最大)水面面积
     * @apiParam   {String}         wqGoal             水质目标
     * @apiParam   {List(String)}   consCondList       (数组)建设状况
     * @apiParam   {Date}           putProdTmBgTm      (开始时间)投产时间
     * @apiParam   {Date}           putProdTmEdTm      (结束时间)投产时间
     * @apiParam   {List(String)}   runCondList        (数组)运行状况
     * @apiParam   {List(String)}   wsCondList         (数组)水源供水持续状况
     * @apiParam   {List(String)}   wsObjList          (数组)供水对象
     * @apiParam   {Double}         dywsPpMin          (最小)设计年供水人口
     * @apiParam   {Double}         dywsPpMax          (最大)设计年供水人口
     * @apiParam   {Double}         dywsWMin           (最小)设计年供水量
     * @apiParam   {Double}         dywsWMax           (最大)设计年供水量
     * @apiParam   {Double}         ddwsWMin           (最小)设计日供水量
     * @apiParam   {Double}         ddwsWMax           (最大)设计日供水量
     * @apiParam   {List(String)}   whsManCdList       (数组)水源地管理单位代码
     * @apiParam   {String}         whsManCd           水源地管理单位代码
     * @apiParam   {List(String)}   whsApprCdList      (数组)水源地审批单位代码
     * @apiParam   {String}         whsApprCd          水源地审批单位代码
     * @apiParam   {List(String)}   emCdList           (数组)应急管理单位代码
     * @apiParam   {String}         emCd               应急管理单位代码
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {Double}         firProAMin         (最小)一级保护区面积
     * @apiParam   {Double}         firProAMax         (最大)一级保护区面积
     * @apiParam   {Double}         secProAMin         (最小)二级保护区面积
     * @apiParam   {Double}         secProAMax         (最大)二级保护区面积
     * @apiParam   {Double}         norProAMin         (最小)准灌溉区面积
     * @apiParam   {Double}         norProAMax         (最大)准灌溉区面积
     * @apiParam   {List(String)}   isEmgList          (数组)是否为应急水源地
     * @apiParam   {List(String)}   monGList           (数组)暂无注释
     * @apiSuccess {String}         swsCd              地表水水源地代码
     * @apiSuccess {String}         swsNm              地表水水源地名称
     * @apiSuccess {String}         swsTp              地表水水源地类型
     * @apiSuccess {Double}         watA               水面面积
     * @apiSuccess {String}         wqGoal             水质目标
     * @apiSuccess {String}         consCond           建设状况
     * @apiSuccess {Date}           putProdTm          投产时间
     * @apiSuccess {String}         runCond            运行状况
     * @apiSuccess {String}         wsCond             水源供水持续状况
     * @apiSuccess {String}         wsObj              供水对象
     * @apiSuccess {Double}         dywsPp             设计年供水人口
     * @apiSuccess {Double}         dywsW              设计年供水量
     * @apiSuccess {Double}         ddwsW              设计日供水量
     * @apiSuccess {String}         whsManCd           水源地管理单位代码
     * @apiSuccess {String}         whsApprCd          水源地审批单位代码
     * @apiSuccess {String}         emCd               应急管理单位代码
     * @apiSuccess {Date}           ts                 时间戳
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {Double}         firProA            一级保护区面积
     * @apiSuccess {Double}         secProA            二级保护区面积
     * @apiSuccess {Double}         norProA            准灌溉区面积
     * @apiSuccess {String}         isEmg              是否为应急水源地
     * @apiSuccess {String}         monG               暂无注释
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(WrSwsBQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 地表水水源地基本信息表,参数 WrSwsBQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, wrSwsBService.selectList(filter))).build();
    }

    /**
     * @api {put} wr/sws/b [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增WR_SWS_B(地表水水源地基本信息表)数据
     * @apiName (generate)add data
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         swsCd              【必须】地表水水源地代码
     * @apiParam   {String}         swsNm              【必须】地表水水源地名称
     * @apiParam   {String}         swsTp              地表水水源地类型
     * @apiParam   {Double}         watA               水面面积
     * @apiParam   {String}         wqGoal             水质目标
     * @apiParam   {String}         consCond           建设状况
     * @apiParam   {Date}           putProdTm          投产时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         runCond            运行状况
     * @apiParam   {String}         wsCond             水源供水持续状况
     * @apiParam   {String}         wsObj              供水对象
     * @apiParam   {Double}         dywsPp             设计年供水人口
     * @apiParam   {Double}         dywsW              设计年供水量
     * @apiParam   {Double}         ddwsW              设计日供水量
     * @apiParam   {String}         whsManCd           水源地管理单位代码
     * @apiParam   {String}         whsApprCd          水源地审批单位代码
     * @apiParam   {String}         emCd               应急管理单位代码
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         nt                 备注
     * @apiParam   {Double}         firProA            一级保护区面积
     * @apiParam   {Double}         secProA            二级保护区面积
     * @apiParam   {Double}         norProA            准灌溉区面积
     * @apiParam   {String}         isEmg              是否为应急水源地
     * @apiParam   {String}         monG               暂无注释
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wr/sws/b
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "swsCd": "420822000008"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "swsCd": "420822000008"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(WrSwsB record) {
        LOGGER.info("新增 地表水水源地基本信息表,参数 WrSwsB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wrSwsBService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} wr/sws/b/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增WR_SWS_B(地表水水源地基本信息表)数据
     * @apiName (generate)addBatch data
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         swsCd              【必须】地表水水源地代码
     * @apiParam   {String}         swsNm              【必须】地表水水源地名称
     * @apiParam   {String}         swsTp              地表水水源地类型
     * @apiParam   {Double}         watA               水面面积
     * @apiParam   {String}         wqGoal             水质目标
     * @apiParam   {String}         consCond           建设状况
     * @apiParam   {Date}           putProdTm          投产时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         runCond            运行状况
     * @apiParam   {String}         wsCond             水源供水持续状况
     * @apiParam   {String}         wsObj              供水对象
     * @apiParam   {Double}         dywsPp             设计年供水人口
     * @apiParam   {Double}         dywsW              设计年供水量
     * @apiParam   {Double}         ddwsW              设计日供水量
     * @apiParam   {String}         whsManCd           水源地管理单位代码
     * @apiParam   {String}         whsApprCd          水源地审批单位代码
     * @apiParam   {String}         emCd               应急管理单位代码
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         nt                 备注
     * @apiParam   {Double}         firProA            一级保护区面积
     * @apiParam   {Double}         secProA            二级保护区面积
     * @apiParam   {Double}         norProA            准灌溉区面积
     * @apiParam   {String}         isEmg              是否为应急水源地
     * @apiParam   {String}         monG               暂无注释
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wr/sws/b/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "swsCd": "420822000008"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "swsCd": "420822000008"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<WrSwsB> recordList) {
        LOGGER.info("批量新增 地表水水源地基本信息表,参数 WrSwsB:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wrSwsBService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} wr/sws/b/{swsCd:\\w{12}}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改WR_SWS_B(地表水水源地基本信息表)数据
     * @apiName (generate)update data
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         swsCd              【必须】地表水水源地代码
     * @apiParam   {String}         swsNm              【必须】地表水水源地名称
     * @apiParam   {String}         swsTp              地表水水源地类型
     * @apiParam   {Double}         watA               水面面积
     * @apiParam   {String}         wqGoal             水质目标
     * @apiParam   {String}         consCond           建设状况
     * @apiParam   {Date}           putProdTm          投产时间
     * @apiParam   {String}         runCond            运行状况
     * @apiParam   {String}         wsCond             水源供水持续状况
     * @apiParam   {String}         wsObj              供水对象
     * @apiParam   {Double}         dywsPp             设计年供水人口
     * @apiParam   {Double}         dywsW              设计年供水量
     * @apiParam   {Double}         ddwsW              设计日供水量
     * @apiParam   {String}         whsManCd           水源地管理单位代码
     * @apiParam   {String}         whsApprCd          水源地审批单位代码
     * @apiParam   {String}         emCd               应急管理单位代码
     * @apiParam   {Date}           ts                 【必须】时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {Double}         firProA            一级保护区面积
     * @apiParam   {Double}         secProA            二级保护区面积
     * @apiParam   {Double}         norProA            准灌溉区面积
     * @apiParam   {String}         isEmg              是否为应急水源地
     * @apiParam   {String}         monG               暂无注释
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wr/sws/b/420822000008/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{swsCd:\\w{12}}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("swsCd") String swsCd, WrSwsB record) {
        record.setSwsCd(swsCd);
        LOGGER.info("根据主键修改 地表水水源地基本信息表,参数 WrSwsB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wrSwsBService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} wr/sws/b/{swsCd:\\w{12}}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改WR_SWS_B(地表水水源地基本信息表)数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         swsCd              地表水水源地代码
     * @apiParam   {String}         swsNm              地表水水源地名称
     * @apiParam   {String}         swsTp              地表水水源地类型
     * @apiParam   {Double}         watA               水面面积
     * @apiParam   {String}         wqGoal             水质目标
     * @apiParam   {String}         consCond           建设状况
     * @apiParam   {Date}           putProdTm          投产时间
     * @apiParam   {String}         runCond            运行状况
     * @apiParam   {String}         wsCond             水源供水持续状况
     * @apiParam   {String}         wsObj              供水对象
     * @apiParam   {Double}         dywsPp             设计年供水人口
     * @apiParam   {Double}         dywsW              设计年供水量
     * @apiParam   {Double}         ddwsW              设计日供水量
     * @apiParam   {String}         whsManCd           水源地管理单位代码
     * @apiParam   {String}         whsApprCd          水源地审批单位代码
     * @apiParam   {String}         emCd               应急管理单位代码
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {Double}         firProA            一级保护区面积
     * @apiParam   {Double}         secProA            二级保护区面积
     * @apiParam   {Double}         norProA            准灌溉区面积
     * @apiParam   {String}         isEmg              是否为应急水源地
     * @apiParam   {String}         monG               暂无注释
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wr/sws/b/420822000008/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{swsCd:\\w{12}}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("swsCd") String swsCd, WrSwsB record) {
        record.setSwsCd(swsCd);
        LOGGER.info("根据主键修改(只修改非null字段) 地表水水源地基本信息表,参数 WrSwsB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wrSwsBService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} wr/sws/b/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改WR_SWS_B(地表水水源地基本信息表)数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         swsCd              地表水水源地代码
     * @apiParam   {String}         swsNm              地表水水源地名称
     * @apiParam   {String}         swsTp              地表水水源地类型
     * @apiParam   {Double}         watA               水面面积
     * @apiParam   {String}         wqGoal             水质目标
     * @apiParam   {String}         consCond           建设状况
     * @apiParam   {Date}           putProdTm          投产时间
     * @apiParam   {String}         runCond            运行状况
     * @apiParam   {String}         wsCond             水源供水持续状况
     * @apiParam   {String}         wsObj              供水对象
     * @apiParam   {Double}         dywsPp             设计年供水人口
     * @apiParam   {Double}         dywsW              设计年供水量
     * @apiParam   {Double}         ddwsW              设计日供水量
     * @apiParam   {String}         whsManCd           水源地管理单位代码
     * @apiParam   {String}         whsApprCd          水源地审批单位代码
     * @apiParam   {String}         emCd               应急管理单位代码
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {Double}         firProA            一级保护区面积
     * @apiParam   {Double}         secProA            二级保护区面积
     * @apiParam   {Double}         norProA            准灌溉区面积
     * @apiParam   {String}         isEmg              是否为应急水源地
     * @apiParam   {String}         monG               暂无注释
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  wr/sws/b/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "swsCd": "420822000008",
     * "swsNm": "汉江沙洋新城水源地",
     * "swsTp": "1",
     * "watA": null,
     * "wqGoal": "2",
     * "consCond": "1",
     * "putProdTm": null,
     * "runCond": "1",
     * "wsCond": null,
     * "wsObj": null,
     * "dywsPp": 0,
     * "dywsW": null,
     * "ddwsW": 0.12,
     * "whsManCd": "011245839",
     * "whsApprCd": "011043321",
     * "emCd": "011043321",
     * "ts": "2014-07-26 16:33:00.0",
     * "nt": null,
     * "firProA": null,
     * "secProA": null,
     * "norProA": null,
     * "isEmg": null,
     * "monG": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<WrSwsB> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) 地表水水源地基本信息表,参数 WrSwsB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wrSwsBService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} wr/sws/b/{swsCd:\\w{12}} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除WR_SWS_B(地表水水源地基本信息表)数据
     * @apiName (generate)delete by primary key
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/sws/b/420822000008
     * @apiParam   {String}         swsCd              【必须】地表水水源地代码
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{swsCd:\\w{12}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("swsCd") String swsCd) {
        LOGGER.info("根据主键删除 地表水水源地基本信息表,参数 swsCd:{}", swsCd);
        Integer rows = wrSwsBService.deleteByPrimaryKey(swsCd);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} wr/sws/b/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除WR_SWS_B(地表水水源地基本信息表)数据
     * @apiName (generate)delete by filter
     * @apiGroup WR_SWS_B-地表水水源地基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/sws/b/by-filter
     * @apiParam   {List(String)}   swsCdList          (数组)地表水水源地代码
     * @apiParam   {String}         swsCd              地表水水源地代码
     * @apiParam   {String}         swsNm              地表水水源地名称
     * @apiParam   {List(String)}   swsTpList          (数组)地表水水源地类型
     * @apiParam   {Double}         watAMin            (最小)水面面积
     * @apiParam   {Double}         watAMax            (最大)水面面积
     * @apiParam   {String}         wqGoal             水质目标
     * @apiParam   {List(String)}   consCondList       (数组)建设状况
     * @apiParam   {Date}           putProdTmBgTm      (开始时间)投产时间
     * @apiParam   {Date}           putProdTmEdTm      (结束时间)投产时间
     * @apiParam   {List(String)}   runCondList        (数组)运行状况
     * @apiParam   {List(String)}   wsCondList         (数组)水源供水持续状况
     * @apiParam   {List(String)}   wsObjList          (数组)供水对象
     * @apiParam   {Double}         dywsPpMin          (最小)设计年供水人口
     * @apiParam   {Double}         dywsPpMax          (最大)设计年供水人口
     * @apiParam   {Double}         dywsWMin           (最小)设计年供水量
     * @apiParam   {Double}         dywsWMax           (最大)设计年供水量
     * @apiParam   {Double}         ddwsWMin           (最小)设计日供水量
     * @apiParam   {Double}         ddwsWMax           (最大)设计日供水量
     * @apiParam   {List(String)}   whsManCdList       (数组)水源地管理单位代码
     * @apiParam   {String}         whsManCd           水源地管理单位代码
     * @apiParam   {List(String)}   whsApprCdList      (数组)水源地审批单位代码
     * @apiParam   {String}         whsApprCd          水源地审批单位代码
     * @apiParam   {List(String)}   emCdList           (数组)应急管理单位代码
     * @apiParam   {String}         emCd               应急管理单位代码
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {Double}         firProAMin         (最小)一级保护区面积
     * @apiParam   {Double}         firProAMax         (最大)一级保护区面积
     * @apiParam   {Double}         secProAMin         (最小)二级保护区面积
     * @apiParam   {Double}         secProAMax         (最大)二级保护区面积
     * @apiParam   {Double}         norProAMin         (最小)准灌溉区面积
     * @apiParam   {Double}         norProAMax         (最大)准灌溉区面积
     * @apiParam   {List(String)}   isEmgList          (数组)是否为应急水源地
     * @apiParam   {List(String)}   monGList           (数组)暂无注释
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(WrSwsBQo filter) {
        LOGGER.info("根据条件删除 地表水水源地基本信息表,参数 WrSwsBQo:{}", filter);
        Integer rows = wrSwsBService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
